package com.qiuzhiyi.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.qiuzhiyi.R;
import com.qiuzhiyi.item.MsgTypeItem;

/**
 * Author: Li
 * Date: 2018/1/8 0008
 * Description:
 */

public class MsgTypeAdapter extends BaseQuickAdapter<MsgTypeItem, BaseViewHolder> {


    public MsgTypeAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, MsgTypeItem item) {

        ImageView imageView = helper.getView(R.id.img);
        int res = R.drawable.qiuzhikefu;
        switch (item.getRemark()) {
            case "求职通知":
                res = R.drawable.qiuzhitongzhi;
                break;

            case "求职推荐":
                res = R.drawable.qiuzhituijian;
                break;
            case "求职客服":
                res = R.drawable.qiuzhikefu;
                break;
        }
        Glide.with(mContext).load(res).into(imageView);

        helper.setText(R.id.txt_type_name, item.getRemark());
    }
}
